﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>抽奖测试页面</title>
    <link href="../../css/bootstrap.min.css" rel="stylesheet" />
    <script src="../../js/jquery-2.1.1.min.js"></script>
    <script src="../../js/bootstrap.min.js"></script>
    <script src="../../js/echarts.js"></script>

    <script type="text/javascript">
        $(function () {
            $("#CheckReg").click(function () {
                $.post("PostHandler.ashx", {
                    action: "CreateJob",
                    JobType: "aa",
                    UserName: "123",
                    Sex: 0,
                    Birthday: "1989-09-05",
                    Salary: "",
                    Mobile: "18664827872",
                    Province: "123456",
                    City: "123456",
                    Area: "213456",
                    Address: "",
                    Email: "",
                    WorkType:"aa"
                }, function (data) {
                    console.log(data);

                });
            })
            $("#InitPool").click(function () {
                $.get("GetHandler.ashx", { "action": "InitNewPool" }, function (data) {
                    //alert(data.Data);
                    console.log(data.Data);
                })
            })
            $("#DrawPrize").click(function () {
                $.post("Posthandler.ashx", { "action": "OpenShopLottery", "openId": "oiz3Mvrq3Z4AVAyBSHusrpVRZtcM" },
                    function (data) {
                        console.log(data.Data);
                    })
            })
            $("#HappyNewYear1").click(function () { //http://rpt.erp-km.cn:58285/weixin/WXActivity/  //{ "action": "HappyNewYear", "openId": "ov9svwkHExZ5L4VjkpX59nTYmAEo" } 011gw4Co0vLBBs1v7Jyo0nm5Co0gw4CZ
                
                $.post("Posthandler.ashx", { "action": "HappyNewYearCheckUser", "code": "ov9svwvUdyfxQOR9g3dbinSpRJuI" },
                        function (data) {
                                console.log(data.Data);
                        })
            })
            $("#HappyNewYear2").click(function () { //http://rpt.erp-km.cn:58285/weixin/WXActivity/ //ov9svwqAvooelc0ci-kzPiwbvsUg  //ov9svwkHExZ5L4VjkpX59nTYmAEo
                //for (var i = 0; i < 5000; i++) {
                    $.post("Posthandler.ashx", { "action": "HappyNewYear", "openId": "ov9svwvUdyfxQOR9g3dbinSpRJuI" },
                        function (data) {
                            //if (data.Data.IsSuc == false) {
                                console.log(data.Data);
                            //}
                        })
                //}
            })
            $("#HappyNewYear5").click(function () { //http://rpt.erp-km.cn:58285/weixin/WXActivity/ //ov9svwqAvooelc0ci-kzPiwbvsUg  //ov9svwkHExZ5L4VjkpX59nTYmAEo
                //for (var i = 0; i < 5000; i++) {
                //    $.post("Posthandler.ashx", { "action": "HappyNewYear", "openId": "ov9svwvUdyfxQOR9g3dbinSpRJuI" },
                //            function (data) {
                //                if (data.Data.IsSuc == false) {
                //                    console.log(data.Data);
                //                }
                //            })
                //}
            })

            $("#HappyNewYear3").click(function () {
                $.post("Posthandler.ashx", { "action": "RemoverRedisKey"},
                        function (data) {
                                console.log(data.Data);
                        })
            })

            $("#HappyNewYear4").click(function () {
                $.post("Posthandler.ashx", { "action": "HappyNewYearCount", "StartDate": "2018-01-20", "EndDate": "2018-01-31" },
                        function (data) {
                            console.log(data.Data);
                        })
            })

            var lodadata = function () {
                $.post("Posthandler.ashx", { "action": "CheckOpenLottery", "openId": "oiz3Mvrq3Z4AVAyBSHusrpVRZtcM" },
                    function (data) {
                        console.log(data.Data);
                    })
            }
            //lodadata();

            var GetOpen = function () {
                $.post("Posthandler.ashx", { "action": "GetOauth2User", "code": "003Bx8Rf1xK1hw0JrrUf11boRf1Bx8R8" },
                    function (data) {
                        console.log(data);
                    })
            }
            //GetOpen();
            $("#startFuc").click(function () {
                var i = setInterval(StartFun, 1000); //86400000:24小时  108000000:30小时

            })
            function StartFun() {
                var d = new Date();
                var hour = d.getHours();
                var m = d.getMinutes();
                var s = d.getSeconds();
                if (hour == 2 && m == 0 && s == 0) {
                    $.get("GetHandler.ashx", { "action": "InitNewPool" }, function (data) {
                        //alert(data.Data);
                        console.log(data.Data);
                    })
                }
                //console.log("I:");
            }

            var GetUser = function () {
                $.post("Posthandler.ashx", { "action": "CreditGetList", "openId": "oiz3MvgCy9lg5HIKUnTsdebgo0sA" },
                    function (data) {
                        console.log(data);
                    })
            }
                //GetUser();

                $("#getcode").click(function () {
                    $.post("Posthandler.ashx", { "action": "GetDetail", "openId": "oiz3MvgCy9lg5HIKUnTsdebgo0sB" },
                    function (data) {
                        console.log(data);
                    })
                })

                $("#savecode").click(function () {
                    $.post("Posthandler.ashx", {
                    "action": "Save",
                    "openId": "oiz3MvgCy9lg5HIKUnTsdebgo0sB",
                    "age":"2",
                    "profession": "公司职员",
                    "quality": "好",
                    "style": "丰富",
                    "evaluate": "价格适中",
                    "service": "满意",
                    "environment": "满意",
                    "shopping": "可能会",
                    "recommend": "会",
                    "suggest": "建议建议"
                    },
                    function (data) {
                        console.log(data);
                    })
                })

                $("#getopenid").click(function () {
                    $.post("Posthandler.ashx", { "action": "GetOpenID", "code": "" },
                    function (data) {
                        console.log(data);
                    })
                })
            $("#abc").click(function() {
                debugger;
                var list = [
                    {
                        "ShopName": "安阳北大街",
                        "Person": "曲梦可",
                        "FirstType": "人",
                        "SecondType": "店铺管理",
                        "Element": "店长管理能力",
                        "Station": "大店长",
                        "Sort": "2"
                    }, {
                        "ShopName": "432",
                        "Person": "44",
                        "FirstType": "人",
                        "SecondType": "店铺管理",
                        "Element": "员工销售技能",
                        "Sort": "2",
                        "Station": "句子"
                    }, {
                        "ShopName": "432",
                        "Person": "44",
                        "FirstType": "场",
                        "SecondType": "默认",
                        "Element": "门头",
                        "Station": "句子",
                        "Sort": "1"
                    }, {
                        "ShopName": "432",
                        "Person": "44",
                        "FirstType": "场",
                        "SecondType": "默认",
                        "Element": "音乐",
                        "Station": "句子",
                        "Sort": "2"
                    }, {
                        "ShopName": "432",
                        "Person": "44",
                        "FirstType": "场",
                        "SecondType": "默认",
                        "Element": "音乐",
                        "Station": "句子",
                        "Sort": "3"
                    }, {
                        "ShopName": "432",
                        "Person": "44",
                        "FirstType": "外部",
                        "SecondType": "默认",
                        "Element": "店铺装修影响店铺业绩",
                        "Station": "句子",
                        "Sort": "1"
                    }, {
                        "ShopName": "432",
                        "Person": "44",
                        "FirstType": "外部",
                        "SecondType": "默认",
                        "Element": "停水电，水浸等影响业绩",
                        "Station": "句子",
                        "Sort": "1"
                    }, {
                        "ShopName": "432",
                        "Person": "44",
                        "FirstType": "外部",
                        "SecondType": "默认",
                        "Element": "消费者购买力",
                        "Station": "句子",
                        "Sort": "2"
                    }, {
                        "ShopName": "432",
                        "Person": "44",
                        "FirstType": "其他因素",
                        "SecondType": "默认",
                        "Element": "其他因素",
                        "Station": "句子",
                        "Sort": 0,
                        "Other": "23423"
                    }
                ];
                $.post("Posthandler.ashx",
                    { "action": "SaveKM", "JsonCode": JSON.stringify(list) },
                    function(data) {
                    })
            });

            $("#efg").click(function() {
                $.post("Posthandler.ashx",
                    { "action": "TimeTrackingReport" },
                    function(data) {
                        console.log(data);
                    })
            });
            $("#hij").click(function() {
                $.post("Posthandler.ashx",
                    { "action": "TimeAnalysisReport", "EndDate1": "2017-08-18 14:00:00", "EndDate2": "2017-08-17 14:00:00", "EndDate3": "2017-08-11 14:00:00" },
                    function(data) {
                        console.log(data.Data);
                    })
            });
        })

    </script>
</head>
<body>
    <!--<button id="CheckReg">检查</button>-->
    <button id="InitPool">初始化奖池</button>
    <button id="DrawPrize">抽奖</button>
    <button id="HappyNewYear1">新年检测用户</button>
    <button id="HappyNewYear2">领红包1</button>
    <button id="HappyNewYear5">领红包2</button>
    <button id="HappyNewYear3">清空红包浏览数缓存</button>
    <button id="HappyNewYear4">领新年红包统计</button>
    <button id="startFuc">启动->初始化奖池</button>
    
    
    <button id="getopenid">Get-OpenId</button>
<button id="getcode">获取数据</button>
<button id="savecode">保存数据</button>
    
    <button id="abc">保存数据</button>
    <button id="efg">保存数据</button>
    <button id="hij">保存数据</button>
</body>
</html> 